<?php
	$path = "data/";
	$json = "json/";
	$year = "2017";
	
	$files = scandir($path);
	$buffer = [];
	foreach($files as $file){
		$sp = explode("-",$file);
		if($sp[0] == $year){
			$fn = $path . $file;
			$buffer[] = json_decode(file_get_contents($fn),true);
		}
	}
	
	file_put_contents($json . $year . ".json",json_encode($buffer));
	exit("Done.");
?>